//
//  VolumeEmptyView.m
//  JiaoX
//
//  Created by jiaoxiu－005 on 15/4/7.
//  Copyright (c) 2015年 北京娇羞科技有限公司. All rights reserved.
//

#import "VolumeEmptyView.h"

@implementation VolumeEmptyView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        NSString *emptyText = @"您暂时没有可用的现金券";
        CGSize emptyTextSize = [emptyText sizeWithFont:[UIFont systemFontOfSize:12]];
        //空图片
        UIImageView *emptyImgView = [[UIImageView alloc]init];
        UIImage *emptyImg = [UIImage imageNamed:@"icon_empty_volume"];
        [emptyImgView setImage:emptyImg];
        [emptyImgView setFrame:CGRectMake(emptyTextSize.width/2-emptyImg.size.width/2, 0, emptyImg.size.width, emptyImg.size.height)];
        [self addSubview:emptyImgView];
        
        //空描述
        UILabel *emptyLable =  [[UILabel alloc]init];
        [emptyLable setText:emptyText];
        [emptyLable setFont:[UIFont systemFontOfSize:12]];
        [emptyLable setTextColor:JXColor(102, 102, 102)];
        [emptyLable setFrame:CGRectMake(0, CGRectGetMaxY(emptyImgView.frame)+JXPublicInset, emptyTextSize.width, emptyTextSize.height)];
        [self addSubview:emptyLable];
        
        [self setBounds:CGRectMake(0, 0, emptyTextSize.width, emptyImg.size.height+JXPublicInset+emptyTextSize.height)];
    }
    return self;
}

@end
